package com.supergzt.utils;


import com.supergzt.constant.TokenConstants;

/**
 * @author 张钧
 * @Description
 * @create 2022-10-20 20:49
 */
public class KeyUtils {

	private static final String SEPARATOR = ":";

	public static String createCode(String uuid){
		return TokenConstants.CODE_UUID + uuid;
	}

	public static String createToken(String id,String key){
		return TokenConstants.ACCESS_TOKEN + id + SEPARATOR + key;
	}

	public static String createScanKey(String keyPrefix, Long userId) {
		return keyPrefix + userId + SEPARATOR + "*";
	}

	public static String createUploadKey(String id){
		return TokenConstants.UPLOAD_TOKEN + id;
	}

	public static String createLoginKey(String phone){
		return TokenConstants.LOGIN_FAIL + phone;
	}
}
